

<template>
    <div class="banner">
        <img src="https://www.wutongyoushu.com/wp-content/themes/zibll/img/user_t.jpg" />
        <div class="banner-content">
            <h2>虚拟资源 共21篇</h2>
        </div>
    </div>
    <div class="project">
        <div class="project-content" v-for="(item, index) in dataList" :key="index">
            <div class="project-content-img">
                <img :src="item.url" />
            </div>
            <div class="project-content-title">{{ item.title }}</div>
            <div class="project-content-explain">
                <span>付费阅读 ${{ item.price }}</span>
                <span>{{ item.type }}</span>
            </div>
            <div class="project-content-releaseTime">发布时间：{{ item.dateTime }}</div>
        </div>
    </div>
</template>
<script setup lang="ts">
import { ref } from 'vue';

/**
 * 项目数据
 */
const dataList = ref<{ title: string, type: string, dateTime: string, price: string, url: string }[]>([
    {
        title: '视频号原创视频玩法，日收益500+',
        type: '副业项目',
        dateTime: '2023-12-10 12:22',
        price: '39',
        url: 'https://www.wutongyoushu.com/wp-content/uploads/2023/12/20231229141808334-1.webp'
    },
    {
        title: '大众点评人计划，简简单单几分钟三位数',
        type: '副业项目',
        dateTime: '2023-12-10 12:22',
        price: '39',
        url: 'https://www.wutongyoushu.com/wp-content/uploads/2023/12/20231229141154493-1.webp'
    },
    {
        title: '大众点评人计划，简简单单几分钟三位数',
        type: '副业项目',
        dateTime: '2023-12-10 12:22',
        price: '39',
        url: 'https://www.wutongyoushu.com/wp-content/uploads/2023/12/20231229141154493-1.webp'
    },
    {
        title: '大众点评人计划，简简单单几分钟三位数',
        type: '副业项目',
        dateTime: '2023-12-10 12:22',
        price: '39',
        url: 'https://www.wutongyoushu.com/wp-content/uploads/2023/12/20231229141154493-1.webp'
    },
    {
        title: '大众点评人计划，简简单单几分钟三位数',
        type: '副业项目',
        dateTime: '2023-12-10 12:22',
        price: '39',
        url: 'https://www.wutongyoushu.com/wp-content/uploads/2023/12/20231229141154493-1.webp'
    },
    {
        title: '大众点评人计划，简简单单几分钟三位数',
        type: '副业项目',
        dateTime: '2023-12-10 12:22',
        price: '39',
        url: 'https://www.wutongyoushu.com/wp-content/uploads/2023/12/20231229141154493-1.webp'
    },
    {
        title: '大众点评人计划，简简单单几分钟三位数',
        type: '副业项目',
        dateTime: '2023-12-10 12:22',
        price: '39',
        url: 'https://www.wutongyoushu.com/wp-content/uploads/2023/12/20231229141154493-1.webp'
    },
    {
        title: '大众点评人计划，简简单单几分钟三位数',
        type: '副业项目',
        dateTime: '2023-12-10 12:22',
        price: '39',
        url: 'https://www.wutongyoushu.com/wp-content/uploads/2023/12/20231229141154493-1.webp'
    },
    {
        title: '大众点评人计划，简简单单几分钟三位数',
        type: '副业项目',
        dateTime: '2023-12-10 12:22',
        price: '39',
        url: 'https://www.wutongyoushu.com/wp-content/uploads/2023/12/20231229141154493-1.webp'
    },
    {
        title: '大众点评人计划，简简单单几分钟三位数',
        type: '副业项目',
        dateTime: '2023-12-10 12:22',
        price: '39',
        url: 'https://www.wutongyoushu.com/wp-content/uploads/2023/12/20231229141154493-1.webp'
    },
    {
        title: '大众点评人计划，简简单单几分钟三位数',
        type: '副业项目',
        dateTime: '2023-12-10 12:22',
        price: '39',
        url: 'https://www.wutongyoushu.com/wp-content/uploads/2023/12/20231229141154493-1.webp'
    },
    {
        title: '大众点评人计划，简简单单几分钟三位数',
        type: '副业项目',
        dateTime: '2023-12-10 12:22',
        price: '39',
        url: 'https://www.wutongyoushu.com/wp-content/uploads/2023/12/20231229141154493-1.webp'
    },
    {
        title: '大众点评人计划，简简单单几分钟三位数',
        type: '副业项目',
        dateTime: '2023-12-10 12:22',
        price: '39',
        url: 'https://www.wutongyoushu.com/wp-content/uploads/2023/12/20231229141154493-1.webp'
    },
    {
        title: '大众点评人计划，简简单单几分钟三位数',
        type: '副业项目',
        dateTime: '2023-12-10 12:22',
        price: '39',
        url: 'https://www.wutongyoushu.com/wp-content/uploads/2023/12/20231229141154493-1.webp'
    },
]);

</script>


<style scoped lang="less">
.banner {
    margin-top: 10px;
    position: relative;

    img {
        border-radius: 10px;
    }

    &-content {
        position: absolute;
        bottom: 0;
        font-size: 16px;
        z-index: 1;
        color: white;
        height: 100px;
        display: flex;
        align-items: center;

        h2 {
            margin-left: 20px;
        }
    }
}
.project {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;

  /* 左右间隔为 10px */
  &-content {
    background: #f04494;
    border-radius: 10px;
    height: 280px;
    flex: 1 0 calc(25% - 8px);
    box-sizing: border-box;
    border: 1px solid #ccc;
    padding: 10px;
    overflow: hidden;
    max-width: calc(25% - 8px);

    &-img {
      width: 100%;
      border-radius: 10px;
      overflow: hidden;

      img {
        width: 100%;
        border-radius: 10px;
        transition: all 1s;
      }
      img:hover {
        transform: scale(1.2);
        cursor: pointer;
      }
    }

    &-title {
      font-weight: bold;
      display: -webkit-box;
      -webkit-box-orient: vertical;
      overflow: hidden;
      -webkit-line-clamp: 2;
      height: 42px;
      // color: #4E5358;
    }

    &-explain {
      font-size: 14px;
      margin-top: 10px;

      span:nth-child(1) {
        background: linear-gradient(135deg, #f59f54 10%, #ff6922 100%);
        padding: 4px;
        color: white;
        border-radius: 5px;
      }

      span:nth-child(2) {
        display: inline-block;
        margin-left: 20px;
        color: #2997f7;
        background: rgba(41, 151, 247, 0.1);
        padding: 4px;
        border-radius: 5px;
      }
    }

    &-releaseTime {
      margin-top: 10px;
      font-size: 14px;
    }
  }
}
</style>
